package com.dream.vo.order;

import java.io.Serializable;

import org.hibernate.validator.constraints.NotBlank;

import com.dream.model.order.OrderCustomer;
import com.dream.vo.base.FirstGroup;

public class CustomerVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1898837776301958244L;
	
	private Long userId;
	
	@NotBlank(message = "err0001",groups = {FirstGroup.class})
	private String userName;
	
	@NotBlank(message = "err0001",groups = {FirstGroup.class})
	private String userType;
	
	@NotBlank(message = "err0001",groups = {FirstGroup.class})
	private String firstOrg;
	
	@NotBlank(message = "err0001",groups = {FirstGroup.class})
	private String secondOrg ;
	
	@NotBlank(message = "err0001",groups = {FirstGroup.class})
	private String mobile;
	
	private Long gender;
	
	@NotBlank(message = "err0001",groups = {FirstGroup.class})
	private String address;
	
	private String zip;
	
	private String phone;
	
	private String email;
	
	private String comment;
	

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getFirstOrg() {
		return firstOrg;
	}

	public void setFirstOrg(String firstOrg) {
		this.firstOrg = firstOrg;
	}

	public String getSecondOrg() {
		return secondOrg;
	}

	public void setSecondOrg(String secondOrg) {
		this.secondOrg = secondOrg;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public Long getGender() {
		return gender;
	}

	public void setGender(Long gender) {
		this.gender = gender;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getZip() {
		return zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
	public void populate(OrderCustomer customer){
		
		if(customer == null){return;}
		
		customer.setAddress(address);
		customer.setComments(comment);
		customer.setEmail(email);
		customer.setGender(gender);
		customer.setMobile(mobile);
		customer.setName(userName);
		customer.setOrgId(Long.parseLong(secondOrg));
		customer.setPhone(phone);
		customer.setType(Long.parseLong(userType));
		customer.setZip(zip);
		
	}
}
